﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>新增器材分类</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script src="js/jquery.js"></script>
    <link href="style/adminStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="wrap">
    <div class="page-title">
        <span class="modular fl"><i></i><em>添加分类</em></span>
    </div>

    <table class="list-style">
        <tr>
            <td style="text-align:right;width:15%;">分类名称：</td>
            <td>
                <input type="text" class="textBox"/>
                <input type="submit" value="保存" class="tdBtn"/>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    $(function () {
        $(".tdBtn").click(function () {
            var itemType=$(".textBox").val()
            if (itemType.length >= 2){
                $.ajax({
                    url:"/cai/itemTypeInsert",
                    type:"post",
                    data:{
                        "itemType": itemType
                    },
                    success:function (data) {
                        if (parseInt(data)!==0){
                            location.href="product_category.jsp"
                        }else {
                            alert("添加失败!")
                        }
                    }
                })
            }else {
                alert("输入字符需要大于1")
            }
        })
    })
</script>
</body>
</html>